<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>纯化难度预测</title>
		<link charset="utf-8" rel="stylesheet" href="__PUBLIC__/static/asset/bootstrap/3.3.6/css/bootstrap.min.css">
		
        <style>
        	.no-padding-right{
        		padding-right : 0!important;
        	}
        	.no-padding-left{
        		padding-left: 0!important;
        	}
            .jumbotron{
            	padding-top: 15px !important;
            	padding-bottom: 15px !important;
            }
        </style>
	</head>
	<body>
		<div class="container-fluid">
			<div class="row">
				<div class="jumbotron">
					<h4><a href="{:config('base')}/index.php"><i class="glyphicon glyphicon-home"></i></a> 纯化难度预测</h4>
					<form id="form-data" action="{:url('result_purify_difficult')}" method="post" class="form-horizontal" onsubmit="return false;">
					<div class="form-group">
						<label class="col-md-10 col-sm-10 col-xs-10 control-label">
							序列（可输入氨基酸单字母或多字母，单字母为大写字母）<a href="#" data-toggle="modal" data-target="#help-modal"><i class="glyphicon glyphicon-question-sign"></i></a>
						</label>
					</div>

					<div class="form-group">
						
						<div class="col-md-10 col-sm-10 col-xs-10 no-padding-left no-padding-right">
							<input type="text" name="amino" value="{$amino|default=''}" class="form-control" id="amino">
						</div>
						<div class="col-md-1  col-sm-2 col-xs-12">
							<button id="calculate-button" type="button" class="btn btn-primary pull-right"> 计算 </button>
						</div>
					</div>

                    <div class="form-group">
                    	<div class="col-md-2 col-sm-2 col-xs-3">
							
						</div>
						<div class="col-md-6 col-sm-6 col-xs-6">
							<label class="col-md-2 control-label no-padding-left no-padding-right">二硫键修饰&nbsp;</label>
							<div class="col-md-4 no-padding-left">
								<input class="form-control" type="text" id="s2" name="s2" placeholder="格式：3-8,5-16">
							</div>
							
							<label class="col-md-2 control-label no-padding-right">成环类型&nbsp;</label>
							<div class="col-md-4 no-padding-left">
								<select id="cyclo-type" name="cyclo-type" class="form-control">
									<option value="-1">未成环</option>
									<option value="0">主链成环</option>
									<option value="1">侧链成环</option>
									<option value="2">主（N端）侧（C端）成环</option>
									<option value="3">侧（N端）主（C端）成环</option>
									<option value="4">硫醚成环</option>
								</select>
								<div id="cyclo-type-info" style="display: none;">
									chainA:
									<select id="cyclo-type-A" name="cyclo-type-A" class="form-control">
										<option value="-1">未成环</option>
										<option value="0">主链成环</option>
										<option value="1">侧链成环</option>
										<option value="2">主（N端）侧（C端）成环</option>
										<option value="3">侧（N端）主（C端）成环</option>
										<option value="4">硫醚成环</option>
									</select>
									
									chainB:
									<select id="cyclo-type-B" name="cyclo-type-B" class="form-control">
										<option value="-1">未成环</option>
										<option value="0">主链成环</option>
										<option value="1">侧链成环</option>
										<option value="2">主（N端）侧（C端）成环</option>
										<option value="3">侧（N端）主（C端）成环</option>
										<option value="4">硫醚成环</option>
									</select>
								</div>
							</div>
							
						</div>
						<label class="col-md-2 col-sm-2 col-xs-3">
							
						</label>
                    </div>
				</form>
				<div id="message-show" class="alert alert-danger hidden" role="alert">警告内容</div>
				</div>
				<!--
                	/.col-md-12
                -->
			</div>
			<!-- /.row -->
			
			<div class="row">
				<div id="result-show" class="col-md-12 hidden">
					<div class="title"><h3>计算结果</h3></div>
					<div class="body" id="result-body"></div>
				</div>
			</div>
		</div>

		<div class="modal fade" id="help-modal">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
						<h4 class="modal-title">纯化难度预算</h4>
					</div>
					<div class="modal-body">
						<div>
							<b>软件使用说明：</b><br>
							1.输入序列并选择修饰类型。为了更好的判断序列，建议特殊序列采用三字母序列进行输入。更多序列举例，<a href="{:url('sample')}" target="_blank">点击此处</a>
							<br>2.关于特殊氨基酸的标示方法，<a href="{:url('amino_detail')}" target="_blank">点击此处</a>
							<br>
							<br>
							<b>为何要预测纯化难度</b>
							<br>1.很多产品由于多肽序列原因，造成纯化困难。而由于生产人员选择了错误的方法，造成纯化失败，甚至损坏柱子和设备。
							<br>2.本软件根据多肽的疏水性和酸碱性以及序列的特殊性质，进行难度预测。
							<br>3.根据多肽的性质，选用不同填料的柱子和不同pH值得缓冲体系，使产品更容易被洗脱下来并提高纯度。
							<br>4.本软件对多肽的难度分为：简单、稍难、难、较难、极难五个级别。
							<br>5.对于简单、稍难的多肽，通常是比较容易纯化的；对于难、较难的订单，纯化难度较大；对于极难的订单，建议修改序列。

						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">确定</button>
					</div>
				</div><!-- /.modal-content -->
			</div><!-- /.modal-dialog -->
		</div><!-- /.modal -->

		<script type="text/html" id="result_template">
			<div class="col-md-12">
				{{# if(d.has_error){ }}
				   {{d.message}}
				{{# }else{ }}
			    {{d.purify_difficult_data.result1||''}}<br>
                {{d.purify_difficult_data.result2||''}}<br>
                {{d.purify_difficult_data.result3||''}}<br>
				<b>纯化难度：</b>{{d.purify_difficult_data.difficult}}<br>
				<b>难度编号：</b><span title="
					{{d.purify_difficult_data.condition1||''}}
					{{d.purify_difficult_data.condition2||''}}
					{{d.purify_difficult_data.condition3||''}}
					{{d.purify_difficult_data.condition4||''}}">
				{{d.purify_difficult_data.code}}
			    </span>
				{{# } }}
			</div>
		</script>
			
		<script src="__PUBLIC__/static/sea.js"></script>
		<script src="__PUBLIC__/static/skin/default/config.js"></script>
		
		<script>
			seajs.use('skin/default/purify_difficult', function(tool){
                tool.initCalculate();
			})
		</script>
	</body>
</html>
